package com.zlz.open.ugs.exception;

import com.zlz.open.ugs.common.config.exception.ExceptionCode;
import com.zlz.open.ugs.common.config.exception.ExceptionCodeDef;

/**
 * @Author: zhulinzhong
 * @Date: 2024/5/21
 */
public class UGSException extends RuntimeException{
    private String code;

    public UGSException(String code, String msg) {
        super(msg);
        this.code = code;
    }

    public UGSException(ExceptionCodeDef code) {
        super(code.getMsg());
        this.code = code.getCode();
    }

    public UGSException(String message) {
        super(message);
    }

    public UGSException(String message, Throwable cause) {
        super(message, cause);
    }

    public UGSException(Throwable cause) {
        super(cause);
    }

    protected UGSException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public String getCode() {
        return code;
    }

}
